import { BaseService, Service } from '../../../utils/request';

@Service('app/comm')
export default class extends BaseService {
	// 翼支付授权登录
	login(params) {
		return this.request({
			url: '/login',
			method: 'POST',
			data: {
				...params
			}
		});
	}

	// 翼支付通过code获取token
	getYzfTokenByCode(params) {
		return this.request({
			url: '/getYzfTokenByCode',
			method: 'POST',
			data: {
				...params
			}
		});
	}
	getUserinfo(params = {}) {
		return this.request({
			url: '/userInfo',
			params
		});
	}

	dialog(params = {}) {
		return this.request({
			url: '/dialog',
			params
		});
	}
	selfmallLogin(params) {
		return this.request({
			url: '/selfmallLogin',
			method: 'POST',
			data: {
				...params
			}
		});
	}
	selfmallLogin2(params) {
		return this.request({
			url: '/selfmallLogin2',
			method: 'POST',
			data: {
				...params
			}
		});
	}
	getSysParam(key) {
		return this.request({
			url: '/getSysParam',
			params: {
				key
			}
		});
	}
	millionSharePic(data) {
		return this.request({
			url: '/millionSharePic',
			method: 'POST',
			data
		});
	}
	loginNoToken(data) {
		return this.request({
			url: '/loginNoToken',
			method: 'POST',
			data
		});
	}

	selfmallStatistics(params) {
		return this.request({
			url: '/app/wechatApplet/addVisitRecordUnAuthorized',
			url_no_prefix: true,
			params
		});
	}
}
